Skip to content

cleanup: remove left over tile emulation code for various formats#5029

Open
jessey-git wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
jessey-git:remove-tile
Open

cleanup: remove left over tile emulation code for various formats#5029
jessey-git wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
jessey-git:remove-tile

Conversation

@jessey-git
Copy link
Contributor

@jessey-git jessey-git commented Feb 2, 2026

Description

Since the OpenImageIO 2.5 series, when calls to check_open were added, any format that did not declare support for "tiles" would immediately fail to open. But many of the formats which attempted to emulate tiles, by buffering the contents and writing it all as scanlines at the end, were not updated. All of the tile emulation code for these formats is effectively dead-code and untested.

Remove the tile emulation code from these formats.

An example of what the failure currently looks like:

>>> out = oiio.ImageOutput.create("test.png")
>>> spec = oiio.ImageSpec(64, 64, 3, 'uint8')
>>> spec.tile_width = 64
>>> out.open("test.png", spec)
False

>>> out.geterror()
'png does not support tiled images'

Tests

None were impacted.

Checklist:

  • I have read the guidelines on contributions and code review procedures.
  • I have updated the documentation if my PR adds features or changes
    behavior.
  • I am sure that this PR's changes are tested somewhere in the
    testsuite
    .
  • I have run and passed the testsuite in CI before submitting the
    PR, by pushing the changes to my fork and seeing that the automated CI
    passed there. (Exceptions: If most tests pass and you can't figure out why
    the remaining ones fail, it's ok to submit the PR and ask for help. Or if
    any failures seem entirely unrelated to your change; sometimes things break
    on the GitHub runners.)
  • My code follows the prevailing code style of this project and I
    fixed any problems reported by the clang-format CI test.
  • If I added or modified a public C++ API call, I have also amended the
    corresponding Python bindings. If altering ImageBufAlgo functions, I also
    exposed the new functionality as oiiotool options.

Signed-off-by: Jesse Yurkovich <jesse.y@gmail.com>
Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lgritz
Copy link
Collaborator

lgritz commented Feb 4, 2026

This is predicated on the following observations:

  1. Some format writers emulated tile output (by buffering) even if they were inherently scanline on disk, but neglected all along to advertise this feature through the API by returning true from supports("tiles").
  2. A change made a couple years ago to OIIO 2.5 inadvertently made it so that requests to write tiles to those formats that didn't do supports("tiles") would fail to open() at all.
  3. Nobody ever noticed this or complained.

So we are inferring that nobody has ever depended on this "scanline file that emulates the tile interface" feature, or they would have noticed that it stopped working.

Therefore, rather than repairing this, Jesse is just ripping out that emulation code entirely.
Removing code that nobody uses is better than maintaining that code indefinitely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants